package com.elitetyc.eliteim.server.config;

import com.elitetyc.eliteim.common.constant.Constants;
import com.elitetyc.eliteim.common.proto.RequestProto;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yuanchao.tan
 * @version 1.0
 * @description TODO
 * @Date 2021/9/16 16:37
 */
@Configuration
@EnableConfigurationProperties(IMServerProperties.class)
public class IMServerConfig {

    /**
     * 注入一个响应单例
     *
     * @return
     */
    @Bean
    public RequestProto.RequestProtocol pong() {
        return RequestProto.RequestProtocol.newBuilder()
                .setData(Constants.DEFAULT_SUCCESS_MSG)
                .setType(Constants.RequestType.PING)
                .setRId(Constants.DEFAULT_RID).build();
    }
}
